package export.bullet
{
	public class NetBullet extends SpecialEffectBullet
	{
		
		public function NetBullet(param1:String)
		{
			this.controlArray = [];
			super(param1);
		}
		
		public var controlArray:Array;
		private var leftPointX:int = 0;
		private var rightPointX:int = 0;
		private var topPointY:int = 0;
		
		override public function step2():void
		{
			var _loc1_:* = undefined;
			if (this.getClip().currentFrame == 1)
			{
				this.leftPointX = this.x - this.getClip().width / 2;
				this.rightPointX = this.x + this.getClip().width / 2;
				this.topPointY = this.y - this.getClip().height / 2;
			}
			for each (_loc1_ in gc.team.getHeroAndPetArray())
			{
				if (this.controlArray.indexOf(_loc1_) == -1)
				{
					if (_loc1_.x > this.leftPointX && _loc1_.x < this.rightPointX && _loc1_.y > this.topPointY)
					{
						this.controlArray.push(_loc1_);
					}
				}
			}
			for each (_loc1_ in this.controlArray)
			{
				if (_loc1_.x < this.leftPointX)
				{
					_loc1_.x = this.leftPointX;
				}
				else if (_loc1_.x > this.rightPointX)
				{
					_loc1_.x = this.rightPointX;
				}
				if (_loc1_.y < this.topPointY)
				{
					_loc1_.y = this.topPointY;
				}
			}
			super.step2();
		}
		
		override public function destroy():void
		{
			super.destroy();
			this.controlArray.length = 0;
		}
	}
}
